
package com.hlkj.pay.dto.merchant.config;
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

import java.math.BigDecimal;
import java.util.List;

import javax.validation.constraints.NotNull;

import com.hlkj.framework.common.util.json.JsonUtils;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * @author HlpayTeam
 * @date 2024/09/12 15:09
 */
@Data
public class MerchantReportConfigDto {

    // 收费模式 外扣 内扣（机构）
    // 计费方式 入金（一般百分比） 出金（一般单笔）

    @Schema(description = "服务商编号")
    private List<String> providerCode;

    @Schema(description = "渠道编号")
    private List<String> channelCode;

    /**
     * 是否禁用：0-否；1-是；
     */
    @Schema(description = "是否启用：0-否；1-是；")
    @NotNull(message = "是否启用 不能为空")
    private Integer status;

    @Schema(description = "收费模式 1: 外扣 0: 内扣")
    private Integer chargeType;

    @Schema(description = "入金收费模式")
    private FeeType inFeeType;

    @Schema(description = "出金收费模式")
    private FeeType outFeeType;

    @Data
    public static class FeeType {

        @Schema(description = "计费方式 1: 单笔费率 2: 单笔固定 3: 费率+固定")
        private Integer type;

        @Schema(description = "费率")
        private BigDecimal fee;

        @Schema(description = "固定金额")
        private BigDecimal amount;
    }

    public static void main(String[] args) {
        MerchantReportConfigDto merchantReportConfigDto = new MerchantReportConfigDto();
        merchantReportConfigDto.setStatus(1);
        merchantReportConfigDto.setChargeType(1);
        FeeType inFeeType = new FeeType();
        inFeeType.setType(1);
        inFeeType.setFee(new BigDecimal("0.01"));
        FeeType outFeeType = new FeeType();
        outFeeType.setType(1);
        outFeeType.setFee(new BigDecimal("0.01"));
        merchantReportConfigDto.setInFeeType(inFeeType);
        merchantReportConfigDto.setOutFeeType(outFeeType);
        System.out.println(JsonUtils.toJsonString(merchantReportConfigDto));
    }
}
